An integer
k
in
Z
n
is a generator of
Z
n
if and only if
gcd
(
n,k
) = 1
.